<template>
	
		<!-- <view>点我</view> -->
		
						<view class="index container">
							<!-- 商品内容 -->
							<!-- <detriment :detriment="detriment"></detriment> -->
							<view class="detriment display-flex justify-between flex-wrap width-100 flex-row">
								<view class="productItem display-flex  width-100"   >
									<!-- 左侧图片 -->
									<div class="left">
										<image src="../../static/img/user/face.jpg"></image>
									</div>
									<!-- 右侧商品介绍 -->
									<div class="message ">
										<!-- 商品名称 -->
										<view class="bigTitle font-bold font-max">
											{{title}}
										</view>
										<!-- 商品价格 -->
							<view class="price display-flex align-end">
							<view class="current display-flex text-primary-color font-maxx" >
								<view class="text-primary-color font-mini">
									￥{{sell_price}}
								</view>
								
							</view>
						</view>
						<view>数量✖1</view>

									</div>
									
								</view>
								<view class="goods-settle-accounts">

											<view class="right">
										
													<view class="goods-count-btn" @click="orderInsert">
														提交订单
													</view>
											</view>
								</view>
							</view>
							
							
						
						</view>
					
	
	
	
	
</template>

<script>
	export default { 
		// props:['detriment'],
		
		data() {
			return {
				uid:'',
				title:'',
				sell_price:'',
			}
		},
		
		methods:{
			 async orderInsert () {
			const res = await this.$myRequest({
						url: '/insertOrder?title='+this.title+'&number='+1+'&img_url='+'../../static/img/user/face.jpg'+'&sell_price='+this.sell_price+'&flag='+1+'&uid='+this.uid
						})
						uni.showModal({
							title:'订单已成功提交'
						})
						uni.reLaunch({
							url:'../index/index'
						})
		
		},
		async getUserInfo(){
			const res = await this.$myRequest({
						url: '/user/getUserInfo'
						})
					
						this.uid=res.data[1]
									
		},

		},
		onLoad(option) {
			console.log(option)
			this.title=option.title
			this.sell_price=option.sell_price
			console.log(this.sell_price)
			this.getUserInfo()
		}
	}
</script>

<style>
/* 整体内容 */
.index{
	margin-top:0upx;
	/* padding-top: -300upx; */
	width:100%;
}
/* 内容 */
.detriment{
	margin-bottom:20upx;
	box-sizing: border-box;
	position: relative;
}
/* 图片 */
.left{
	margin-left:50upx;
	display: inline-block;

}
.left image{
	width: 250upx;
	height: 250upx;
	margin: 0 auto;
	
}
/* 右侧介绍 */
.message{
	display: inline-block;
	/* padding-bottom: -100upx; */
	margin-left: 40upx;
	position: absolute;
	/* margin-top: -20upx; */
	float: left;
	
}
.goods-settle-accounts {
		height: 96upx;
		position: fixed;
		bottom: 50px;
		z-index: 99;
		width: 100%;
		background-color: #FFFFFF;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 30upx;
		border-top: 1upx solid $border-color-whiteSmoke;
		
 }
	.goods-settle-accounts	.left {
			display: flex;
			align-items: center;
 }
		.goods-settle-accounts	.left	.select {
				width: 100upx;
				
			}
		
 /* .allBtn[data-v-87593cb8] {
     width: 106px;
     height: 77px;
     line-height: 82px;
     display: inline-block;
	 } */
	.goods-settle-accounts	.right {
			display: flex;
			align-items: center;
			
 }
		.goods-settle-accounts	.right	.goods-price-total {
				font-size: 32upx;
				
			}
 
		.goods-settle-accounts	.right	.goods-price-total text:nth-child(2) {
			
				font-size: 32upx;
				padding-top: 4upx;
				margin-left: 8upx;
				color: #f06c7a;
			}
 
		.goods-settle-accounts	.right	.goods-count-btn {
			    
				font-size: 32upx;
				width: 180upx;
				background-color:  #f06c7a;
				border-radius: 30upx;
				height: 66upx;
				text-align: center;
				line-height: 66upx;
				margin-left: 500upx;
			}
 
		.goods-settle-accounts	.right	.goods-enshrine {
				color: $base-color;
				padding: 5upx 20upx;
				border: 1upx solid $base-color;
				border-radius: 30upx;
				margin-right: 30upx;
			}
 
		.goods-settle-accounts	.right	.goods-delete {
				color: $font-colo-orange;
				padding: 5upx 20upx;
				border: 1upx solid $font-colo-orange;
				border-radius: 30upx;
			}
		
	.current{
		margin-right: 10upx;
	}
.text-primary-color{
	color: #f06c7a;
}
.text-else-color{
	font-size: 12px;
	text-decoration: line-through;
}
.empty-tips{
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 300upx;
}

</style>
